package com.iotechn.unimall.data.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iotechn.unimall.data.domain.RunningGroupUserDO;
import com.iotechn.unimall.data.domain.UserDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by rize on 2019/7/1.
 */
public interface RunningGroupUserMapper extends BaseMapper<RunningGroupUserDO> {

    RunningGroupUserDO selectByGroupIdAndUserId(@Param("groupId") Long groupId,@Param("userId") Long userId);

    List<RunningGroupUserDO> selectByUserId(@Param("userId") Long userId);

    int deleteByGroupIdAndUserId(@Param("groupId") Long groupId, @Param("userId") Long userId);

    /**
     * 查询当前跑团的管理员
     * @param page
     * @param groupId
     * @return
     */
    List<UserDO> selectAdminPage(Page page,@Param("groupId") Long groupId);


}
